package io;

import java.io.File;

import javax.swing.filechooser.FileFilter;

class SaveFileFilter extends FileFilter{

	
	public boolean accept(File f) {
		if (f.isDirectory()) {
			return true;
		}

		String extension = FileExtensionUtils.getExtension(f);
		if (extension != null) {
			if (extension.equals(FileExtensionUtils.JPEG)||
					extension.equals(FileExtensionUtils.GIF)||
					extension.equals(FileExtensionUtils.BMP)||
					extension.equals(FileExtensionUtils.PNG)||
					extension.equals(FileExtensionUtils.XML)){
				return true;
			} else {
				return false;
			}
		}

		return false;
	}

	
	public String getDescription() {
		return "File Extensions (*.xml, *.jpg, *.gif, *.bmp, *.png)";
	}

}
